package com.moon.interview.common;

import com.moon.interview.exception.SysErrorCode;
import lombok.Data;

@Data
public class BaseResponse<T> {

    private int code;

    private T data;

    private String message;

    public BaseResponse(int code, T data, String message) {
        this.code = code;
        this.data = data;
        this.message = message;
    }

    public BaseResponse(int code, T data){
        this(code,data,null);
    }

    public BaseResponse(SysErrorCode errorCode, String message) {
        this(errorCode.getCode(), null, errorCode.getMessage()+":"+message);
    }

    public BaseResponse(SysErrorCode errorCode) {
        this(errorCode, null);
    }
}
